<%@ page import="java.util.List" %>
<%@ page import="top.xuwuqiang.study.jacawebjdbc.entity.Tbmovie" %>
<%@ page import="top.xuwuqiang.study.jacawebjdbc.dao.TbMovieDAO" %><%--
  Created by IntelliJ IDEA.
  User: 17505
  Date: 2024/5/28
  Time: 14:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="../lib/bootstarp.min.css">

</head>
<body>
<%
    List<Tbmovie> list = TbMovieDAO.query();
%>

<div style="padding: 1rem;">
    <div>
        <a class="table-light" href="insert.jsp"> 发布电影信息</a>
    </div>
    <div>电影列表</div>

    <table class="table table-hover table-striped table-bordered">
        <thead>
        <tr class="text-bg-light">
            <th>编号</th>
            <th>电影名称</th>
            <th>电影简介</th>
            <th>电影评分</th>
            <th>上映时间</th>
            <th>操作</th>

        </tr>
        </thead>


        <tbody>
            <%
    for (Tbmovie movie : list) {
%>
        <tr>
            <td><%=movie.getId()%>
            </td>
            <td><%=movie.getMovie()%>
            </td>
            <td><%=movie.getInfo()%>
            </td>
            <td><%=movie.getScore()%>
            </td>
            <td><%=movie.getCreated()%>
            </td>

            <td>
                <a class="btn btn-danger btn-sm" href="delete.jsp?id=<%=movie.getId()%>">删除</a>
            </td>

        </tr>
            <%
    }
%>
        </tbody>
    </table>
</div>


</tbody>


<script src="../lib/bootstarp.min.js"></script>
</body>
</html>
